#!/usr/bin/bash

set -e

DAV1D_FORK=https://github.com/videolan/dav1d/archive/refs/tags/0.9.0.zip
DAV1D_LOCAL_REPO=./extra/dav1d
DAV1D_BRANCH=dav1d-0.9.0

function pull_repo()
{
    echo "Deleting old repo: "$2
    rm -rf $2
    mkdir -p $2
    curl -L -o repo.zip $1
	unzip repo.zip -d $2
	mv $2/$3/* $2/ && rm -rf $2/$3
	rm -rf repo.zip
}

pull_repo $DAV1D_FORK $DAV1D_LOCAL_REPO $DAV1D_BRANCH

SPEEX_FORK=https://github.com/xiph/speex/archive/refs/tags/Speex-1.2.1.zip
SPEEX_LOCAL_REPO=./extra/speex
SPEEX_BRANCH=speex-Speex-1.2.1

pull_repo $SPEEX_FORK $SPEEX_LOCAL_REPO $SPEEX_BRANCH

